package com.abyss.source;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.operators.DataSource;
import org.apache.flink.configuration.Configuration;
/**
 * @author Abyss
 * @date 2020/10/4
 * @description 递归读取文件夹中的内容
 */
public class RecursiveFileReadSourceDemo {

    public static void main(String[] args) throws Exception {
        // 1. env
        ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

        // 2. Source
        Configuration configuration = new Configuration();
        // 表示递归读取
        configuration.setBoolean("recursive.file.enumeration", true);
        DataSource<String> recursiveSource = env.readTextFile("/Users/abyss/Dev/toys/flink/H-flink-learn/src/main/resources").withParameters(configuration);

        recursiveSource.print();
    }
}
